/**
 * @(#)IDmChannelRetentDAO.java 2016年5月25日
 * Copyright(C) 2015 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.dao;

import java.util.List;
import java.util.Map;

import org.jsbd.boss.domian.ChannelMonitorExportInfo;
import org.jsbd.boss.domian.ChannelMonitorInfo;
import org.jsbd.boss.domian.ChannelRetentLogInfo;
import org.jsbd.boss.domian.ChannelRetentMonitorInfo;
import org.jsbd.boss.domian.channel.ApkTaskInfo;
import org.jsbd.boss.domian.channel.RetentQueryVo;
import org.jsbd.boss.domian.channel.RetentTaskVo;
import org.jsbd.boss.domian.channel.TaskQueryVo;
import org.jsbd.boss.domian.statistics.ImsiretentResultVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * TODO 请加入本类的说明
 * 
 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
 * @version 1.0.0
 */
public interface IDmChannelRetentDAO {
	public static final Logger LOGGER = LoggerFactory.getLogger(IDmChannelRetentDAO.class);

//	public int getDmChannelRetentTotalCount(String date, String exetimes, String mark);

	public List<RetentTaskVo> getDmChannelRetentBydate(String date, int limit, String maxexetime, String mark);

	public int getDmChannelCurrentRetentSuccessCount(String date, String exetimes, String mark);

	public int getDmChannelCurrentRetentTotalCount(String date, String exetimes, String mark);

	public List<RetentTaskVo> getDmChannelCurrentRetentBydate(String date, int limit, String currentMaxexetime, String mark);

	/**
	 * 
	 * getChannelRetentLog:查询所有
	 * 
	 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
	 * @param channelRetentLogInfo
	 * @return
	 */
	public List<ChannelRetentLogInfo> getChannelRetentALLLog(ChannelRetentLogInfo channelRetentLogInfo);

	/**
	 * 
	 * getChannelRetentLog:查询所有留存用户
	 * 
	 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
	 * @param channelRetentLogInfo
	 * @return
	 */
	public List<ChannelRetentLogInfo> getChannelRetentLog(ChannelRetentLogInfo channelRetentLogInfo);

	public int selectSuccessMark(String mark);

	public int getDmChannelRetentSuccessCount(String date, String mark);

	/**
	 * selectChannelRetentLogOfDay:查询指定日期的mark留存任务
	 * 
	 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
	 * @param channelRetentLogInfo
	 * @return
	 */
	public List<ChannelRetentLogInfo> selectChannelRetentLogOfDay(ChannelRetentLogInfo channelRetentLogInfo);

	/**
	 * 
	 * getRetentTask:查询留存任务
	 * 
	 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
	 * @param queryVo
	 * @return
	 */
	public List<RetentTaskVo> getRetentTask(RetentQueryVo queryVo);

	/**
	 * updateExecTimesOfDay:更新执行次数
	 * 
	 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
	 * @param dayStr
	 * @return
	 */
	public Integer updateExecTimesOfDay(String dayStr);

	public List<ApkTaskInfo> selectCountNewTask(TaskQueryVo queryVo);

	/**
	 * 
	 * getChannelMonitorInfo:mark任务监控
	 * 
	 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
	 * @param time
	 * @return
	 */
	public List<ChannelMonitorInfo> getChannelMonitorInfo(String time);

	/**
	 * 
	 * getChannelMonitorInfo:mark任务监控
	 * 
	 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
	 * @param time
	 * @return
	 */
	public List<ChannelRetentMonitorInfo> getChannelRetentMonitorInfo(String time);

	/**
	 * 
	 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
	 * @param time
	 * @return
	 */
	public int getChannelPlanRetentInfo(String mark, String date);

	/**
	 * 
	 * selectCountRetentTask:留存任务查询
	 * 
	 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
	 * @param queryVo
	 * @return
	 */
	public List<ApkTaskInfo> selectCountRetentTask(TaskQueryVo queryVo);

	/**
	 * 
	 * getChannelMonitorInfo:mark任务监控(生成报警邮件)
	 * 
	 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
	 * @param time
	 * @return
	 */
	public List<ChannelMonitorExportInfo> getChannelMonitorExportInfo(String time, String date, String yesterday);

	/**
	 * 
	 * getMarkPhoneRateFromRetent:获取每个mark对应的手机号码获取比例
	 * 
	 * @author <a href="mailto:zhouchao@xingbook.com" >周超</a>
	 * @param conditionMap
	 * @return
	 */
	public List<Map<String, Object>> getMarkPhoneRateFromRetent(Map<String, Object> conditionMap);

	/**
	 * selectTotalNewTask:TODO 请描述该方法是做什么用途的
	 * 
	 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
	 * @param queryVo
	 * @return
	 */
	public List<ApkTaskInfo> selectTotalNewTask(TaskQueryVo queryVo);

	/**
	 * 
	 * selectReadNewTaskPay:阅读支付数量
	 * 
	 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
	 * @param queryVo
	 * @return
	 */
	public List<ApkTaskInfo> selectReadNewTaskPay(TaskQueryVo queryVo);

	/**
	 * selectTaskInfo:TODO 请描述该方法是做什么用途的
	 * 
	 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
	 * @param taskInfo
	 * @return
	 */
	public RetentTaskVo selectTaskInfo(RetentTaskVo taskInfo);

	/**
	 * selectFileName:TODO 请描述该方法是做什么用途的
	 * 
	 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
	 * @param day
	 * @return
	 */
	public List<RetentTaskVo> selectFileName(String day);
    
	/**
	 * 根据table 名称查询所有相关表
	 * @param tableName
	 * @return
	 */
	public List<String> getAllTableByTableName(String tableName);
    
	/**
	 * 根据table和mark 查找对应mark的数量
	 * @param imsiretent
	 * @return
	 */
	public List<ImsiretentResultVo> selectByMark(ImsiretentResultVo imsiretent);

	void batchDelete(List<RetentTaskVo> records);

	int updateRetent(RetentTaskVo taskVo);

	void insert(RetentTaskVo taskVo);

	void insertLog(RetentTaskVo taskVo);

	int updateRetentTimes(RetentTaskVo retentTaskVo);

}
